package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2022-05-07
 * Time: 17:59
 */
public class BookList { //存书的地方 相当于书架 涉及存储 用数据结构来完成
    private Book[] books = new Book[10];
    private int usedSize;

    public BookList(){
        books[0] = new Book("三国演义","罗贯中",17,"小说");
        books[1] = new Book("西游记","吴承恩",25,"小说");
        books[2] = new Book("水浒传","施耐庵",100,"小说");

        this.usedSize = 3;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }

    //获取pos位置的书
    public Book getPos(int pos){
        return this.books[pos];
    }

    // 在pos位置 新增图书
    public void setBooks(int pos ,Book book){
        this.books[pos] = book;
    }

}
